<!DOCTYPE html>
<html>
<head>
  <title>SingularityOAuth</title>
  <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
  <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
  <link href="//cdn.bootcss.com/font-awesome/4.4.0/css/font-awesome.min.css" rel="stylesheet">
  <%= csrf_meta_tags %>
</head>
<body class="login-page">

<div class="login-box">
  <div class="login-logo">
    <a><b class="text-red">Singularity</b><b class="text-blue">Club</b></a>
  </div>
  <!-- /.login-logo -->
  <div class="login-box-body">
    <% if flash[:alert].present? %>
        <div class="alert alert-warning alert-dismissable">
          <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
          <h4><i class="icon fa fa-warning"></i>错误!</h4>
          <%= flash[:alert] %>
        </div>
    <% end %>
    <p class="login-box-msg">用邮箱地址登陆</p>

    <%= form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %>
        <form action="" method="post">
          <div class="form-group has-feedback">
            <input autofocus="autofocus" type="email" value="" name="user[email]" id="user_email" class="form-control" placeholder="邮箱/学号/手机">
            <span class="glyphicon glyphicon-envelope form-control-feedback"></span>
          </div>
          <div class="form-group has-feedback">
            <input autocomplete="off" type="password" name="user[password]" id="user_password" class="form-control" placeholder="密码">
            <span class="glyphicon glyphicon-lock form-control-feedback"></span>
          </div>
          <div class="row">
            <div class="col-xs-8">

              <% if devise_mapping.rememberable? -%>
                  <div class="checkbox icheck">
                    <label>
                      <input type="checkbox" value="1" name="user[remember_me]" id="user_remember_me"> 记住我
                    </label>
                  </div>
              <% end -%>
            </div>
            <!-- /.col -->
            <div class="col-xs-4">
              <button type="submit" class="btn btn-primary btn-block btn-flat">登陆</button>
            </div>
            <!-- /.col -->
          </div>
        </form>


        <div class="social-auth-links text-center">
          <p>- OR -</p>
          <a href="<%= new_registration_path(resource_name) %>" class="btn btn-block btn-social btn-facebook btn-flat"><i class="fa fa-sign-in"></i>注册</a>
        </div>
        <!-- /.social-auth-links -->
        <%- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations' %>
            <%= link_to "忘记密码?", new_password_path(resource_name) %><br/>
        <% end -%>
    <% end %>
  </div>
  <!-- /.login-box-body -->
</div>
<!-- /.login-box -->

<script>
    $(function () {
        $('input').iCheck({
            checkboxClass: 'icheckbox_square-blue',
            radioClass: 'iradio_square-blue',
            increaseArea: '20%' // optional
        });
    });
</script>
</body>
</html>
